{extend name="base" /}

{block name="header"}
{js file="__STATIC__/js/plugins/media/fancybox.min.js"}
{/block}

{block name="content"}
	<div class="card">
		<div class="card-header header-elements-inline">
			<h5 class="card-title">{$meta_title}</h5>
			<div class="header-elements">
				<div class="list-icons">
					<a class="list-icons-item" data-action="collapse"></a>
					<a class="list-icons-item" data-action="reload"></a>
				</div>
			</div>
		</div>

		<div class="card-body">
			<form action="{:url()}">

				<div class="form-group row">
					<label class="col-lg-2 col-form-label">账号:</label>
					<div class="col-lg-8">
						{$adminInfo.name}
					</div>
				</div>

				<div class="form-group row">
					<label class="col-lg-2 col-form-label">原密码:</label>
					<div class="col-lg-8">
						<input type="password" name="oldpwd" class="form-control" placeholder="原始密码">
					</div>
				</div>

				<div class="form-group row">
					<label class="col-lg-2 col-form-label">新密码:</label>
					<div class="col-lg-8">
						<input type="password" name="newpwd" class="form-control" placeholder="新设密码">
					</div>
				</div>

				<div class="form-group row">
					<label class="col-lg-2 col-form-label">重复密码:</label>
					<div class="col-lg-8">
						<input type="password" name="newpwd2" class="form-control" placeholder="新设密码">
					</div>
				</div>

				<div class="text-left">
					<label class="col-lg-2 col-form-label"></label>
					<button type="submit" class="btn btn-primary"><i class="icon-paperplane mr-2"></i> 提交保存</button>
				</div>
			</form>
		</div>
	</div>
{/block}
{block name="script"}
<script>
	$(function(){

        $("button[type=submit]").click(function (e) {
			e.preventDefault();

            var data = $(this).parents("form").serializeArray();
			var url = $(this).parents("form").attr("action");
			$.post(url, data, function (res) {
				console.log(res);
				if(res.code){
				    Helper.successNotify(res.msg, res.url);
				}else{
				    Helper.alertNotify(res.msg);
				}

            }, 'json')
        })
	})
</script>
{/block}
